home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part2 / 18492 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  887 b 

  1. Path: news.mindspring.com!usenet
  2. From: mroot@atl.mindspring.com (Danette & Murray Root)
  3. Newsgroups: comp.lang.c++
  4. Subject: Re: Help!!!!!! for BC4.5
  5. Date: Sun, 21 Apr 1996 02:15:48 GMT
  6. Organization: MindSpring Enterprises
  7. Message-ID: <4lc5m2$a2k@mule1.mindspring.com>
  8. References: <4l9hrs$506@castle.nando.net>
  9. NNTP-Posting-Host: user-168-121-127-88.dialup.mindspring.com
  10. X-Newsreader: Forte Free Agent 1.0.82
  11.  
  12. Charlie Jiang <hongjun@nando.net> wrote:
  13.  
  14. -----snip----
  15.  
  16. =>---the SWITCH loop.
  17. =>it comes out the error message like "case bypassing initialization of a 
  18. =>local variable in function main[]". Oh, by the way, I have put more than 
  19. =>one SWITCH loop in each 'case:'.
  20.  
  21. where you have:
  22.  
  23. case x:
  24.     int y = some_value;
  25.     do-something;
  26.  
  27. change it to:
  28.  
  29. case x;
  30. {
  31.     int y = some_value;
  32.     do_something;
  33. }
  34.  
  35. if y is not used later. if it is, put the 
  36.  
  37. int y = some_value;
  38.  
  39. before the switch.
  40.  
  41.  
  42.